// insert ... 语句

const { Blog, User } = require('./model')

!(async function(){
  // 创建用户
  const zhangsan = await User.create({
    userName:'zhangsan',
    password:'123',
    nickName:'张三'
  })
  // insert into users (...) values (...)
  console.log('zhangsan: ',zhangsan.dataValues)
  const zhangsanId = zhangsan.dataValues.id
  const lisi = await User.create({
    userName:'lisi',
    password:'123',
    nickName:'李四'
  })
  // insert into users (...) values (...)
  console.log('lisi: ',lisi.dataValues)

  const blog1 = await Blog.create({
    title: '标题1',
    content:'内容1',
    userId: zhangsanId
  })
  console.log('blog1: ',blog1.dataValues)
})()